Implementing handler by script

Description

Implement those processes for the commands and events defined in the manifest as extension points. The functions that implement these processes are called command handler and event handler. Implement those handlers in the script file specified as the entry point in the manifest.

Implementation example

Here is an implementation example of the command handler when the following command is defined in the manifest.

Manifest command definition example

  "extensionPoints": {
    "commands": [
      {
        "id": "Command.SayHello",
        "execFunc": "SayHello"
      }
    ],
    ...
  }

In the case of the above command definition example, the command handler named SayHello specified in the extensionPoints.commands[0].execFunc property is implemented as a public function in the entry point script file.

Example of command handler implementation in script file

//command handler
public void SayHello(ICommandContext context,ICommandParams commandParams)
{
    App.Window.UI.ShowInformationDialog("Hello !","Hello World");
}

Reference

important

  • The handler must be implemented as a public function.
  • All handlers must be implemented in the script file specified in the entry point.